package cn.edu.zut.cs.Business;

import cn.edu.zut.cs.DAO.bookDAO;
import cn.edu.zut.cs.Model.book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class bookService {
    bookDAO bookDAO;
    @Autowired
    public void setBookDAO(bookDAO bookDAO) {
        this.bookDAO = bookDAO;
    }
    public void insert_book(book book){
        bookDAO.insertBook(book);
    }
public void deletbook(book book,String isdn){bookDAO.deleteBookByIsdn(isdn);}
    public void updatebook(book book,String isdn,String bname,String author,float price)
    {
        book.setIsdn(isdn);
        book.setBname(bname);
        book.setAuthor(author);
        book.setPrice(price);
        bookDAO.modifyBook(book);
    }
}
